package com.qcxk.yuqian.system.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qcxk.yuqian.system.entity.Organ;
import com.qcxk.yuqian.system.entity.SysSet;
import com.qcxk.yuqian.system.mapper.SysSetMapper;
import com.qcxk.yuqian.system.service.SysSetService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysSetServiceImp extends ServiceImpl<SysSetMapper, SysSet> implements SysSetService {

    @Autowired
    private SysSetMapper sysSetMapper;


    @Override
    public Page querySysSetList(Page page, SysSet sysSet) {
        QueryWrapper<SysSet> sysSetQueryWrapper = new QueryWrapper<>();
        if (StringUtils.isNotBlank(sysSet.getName())) {
            sysSetQueryWrapper.like("name", sysSet.getName());
        }
        if (StringUtils.isNotBlank(sysSet.getCode())) {
            sysSetQueryWrapper.like("code", sysSet.getCode());
        }
        sysSetMapper.selectPage(page, sysSetQueryWrapper);
        return page;
    }

    @Override
    public boolean updateOrgan(Organ organ) {
        return false;
    }

    @Override
    public boolean removeRole(Integer id) {
        return false;
    }

    @Override
    public boolean grantAuthToRole(Integer roleId, Integer[] idarr) {
        return false;
    }

    @Override
    public boolean grantRoleForUser(Integer userId, Integer roleId) {
        return false;
    }
}
